package cn.com.api.service.impl.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.api.entity.ApiT_news;

import cn.com.api.mapper.ApiT_newsMapper;

import cn.com.api.service.ApiT_newsService;

/**
 * 
 **/
@Service
public class T_newsServiceImplBase {
	@Autowired
	private ApiT_newsMapper apiT_newsMapper;
    
    // 根据id获取
	public ApiT_news findT_newsById(Integer id){
		ApiT_news t_news = apiT_newsMapper.findT_newsById( id );
		return t_news;
	}
    
    //查看数据集
	public List<ApiT_news> findT_newss(){
        List<ApiT_news> t_newss = apiT_newsMapper.findT_newss();
		return t_newss;
    }
    
	// 添加
	public int insertT_news(ApiT_news t_news){
		int ret_I= apiT_newsMapper.insertT_news(t_news);
		return ret_I;
	}

	// 修改
	public int updateT_news(ApiT_news t_news){
		int ret_I= apiT_newsMapper.updateT_news(t_news);
		return ret_I;
	}
	
    // 删除
	public int deleteT_news(Integer id){
		int ret_I= apiT_newsMapper.deleteT_news( id );
		return ret_I;
	}
	
    // Foreign keys revelant		
		

	//region Indexs revelant
    
    
    //获取根据ctype	
    public List<ApiT_news> findT_newssByCtype(String ctype){
        List<ApiT_news> t_newss = apiT_newsMapper.findT_newssByCtype(ctype);
		return t_newss;
    }
    		
    //获取根据titles	
    public List<ApiT_news> findT_newssByTitles(String titles){
        List<ApiT_news> t_newss = apiT_newsMapper.findT_newssByTitles(titles);
		return t_newss;
    }
    		
    
    
}


